Optimal. Leaf size=115 \[ -\frac {\tanh ^{-1}(\cos (c+d x))}{a^2 d}+\frac {\sec (c+d x)}{a^2 d}+\frac {\sec ^3(c+d x)}{3 a^2 d}+\frac {2 \sec ^5(c+d x)}{5 a^2 d}-\frac {2 \tan (c+d x)}{a^2 d}-\frac {4 \tan ^3(c+d x)}{3 a^2 d}-\frac {2 \tan ^5(c+d x)}{5 a^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 115, normalized size of antiderivative = 1.00, number of steps
used = 11, number of rules used = 8, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.296, Rules used = {2954, 2952,
3852, 2702, 308, 213, 2686, 30} \begin {gather*} -\frac {2 \tan ^5(c+d x)}{5 a^2 d}-\frac {4 \tan ^3(c+d x)}{3 a^2 d}-\frac {2 \tan (c+d x)}{a^2 d}+\frac {2 \sec ^5(c+d x)}{5 a^2 d}+\frac {\sec ^3(c+d x)}{3 a^2 d}+\frac {\sec (c+d x)}{a^2 d}-\frac {\tanh ^{-1}(\cos (c+d x))}{a^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 213
Rule 308
Rule 2686
Rule 2702
Rule 2952
Rule 2954
Rule 3852
Rubi steps
\begin {align*} \int \frac {\csc (c+d x) \sec ^2(c+d x)}{(a+a \sin (c+d x))^2} \, dx &=\frac {\int \csc (c+d x) \sec ^6(c+d x) (a-a \sin (c+d x))^2 \, dx}{a^4}\\ &=\frac {\int \left (-2 a^2 \sec ^6(c+d x)+a^2 \csc (c+d x) \sec ^6(c+d x)+a^2 \sec ^5(c+d x) \tan (c+d x)\right ) \, dx}{a^4}\\ &=\frac {\int \csc (c+d x) \sec ^6(c+d x) \, dx}{a^2}+\frac {\int \sec ^5(c+d x) \tan (c+d x) \, dx}{a^2}-\frac {2 \int \sec ^6(c+d x) \, dx}{a^2}\\ &=\frac {\text {Subst}\left (\int x^4 \, dx,x,\sec (c+d x)\right )}{a^2 d}+\frac {\text {Subst}\left (\int \frac {x^6}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{a^2 d}+\frac {2 \text {Subst}\left (\int \left (1+2 x^2+x^4\right ) \, dx,x,-\tan (c+d x)\right )}{a^2 d}\\ &=\frac {\sec ^5(c+d x)}{5 a^2 d}-\frac {2 \tan (c+d x)}{a^2 d}-\frac {4 \tan ^3(c+d x)}{3 a^2 d}-\frac {2 \tan ^5(c+d x)}{5 a^2 d}+\frac {\text {Subst}\left (\int \left (1+x^2+x^4+\frac {1}{-1+x^2}\right ) \, dx,x,\sec (c+d x)\right )}{a^2 d}\\ &=\frac {\sec (c+d x)}{a^2 d}+\frac {\sec ^3(c+d x)}{3 a^2 d}+\frac {2 \sec ^5(c+d x)}{5 a^2 d}-\frac {2 \tan (c+d x)}{a^2 d}-\frac {4 \tan ^3(c+d x)}{3 a^2 d}-\frac {2 \tan ^5(c+d x)}{5 a^2 d}+\frac {\text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{a^2 d}\\ &=-\frac {\tanh ^{-1}(\cos (c+d x))}{a^2 d}+\frac {\sec (c+d x)}{a^2 d}+\frac {\sec ^3(c+d x)}{3 a^2 d}+\frac {2 \sec ^5(c+d x)}{5 a^2 d}-\frac {2 \tan (c+d x)}{a^2 d}-\frac {4 \tan ^3(c+d x)}{3 a^2 d}-\frac {2 \tan ^5(c+d x)}{5 a^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.35, size = 196, normalized size = 1.70 \begin {gather*} \frac {\sec (c+d x) \left (280+136 \cos (2 (c+d x))+79 \cos (3 (c+d x))+60 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-5 \cos (c+d x) \left (79+60 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-60 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )-60 \cos (3 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+160 \sin (c+d x)-316 \sin (2 (c+d x))-240 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \sin (2 (c+d x))+240 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (2 (c+d x))+64 \sin (3 (c+d x))\right )}{240 a^2 d (1+\sin (c+d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.28, size = 109, normalized size = 0.95
method | result | size |
derivativedivides | \(\frac {-\frac {1}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {4}{5 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{5}}-\frac {2}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{4}}+\frac {11}{3 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}-\frac {7}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {17}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{2}}\) | \(109\) |
default | \(\frac {-\frac {1}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {4}{5 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{5}}-\frac {2}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{4}}+\frac {11}{3 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}-\frac {7}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {17}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{2}}\) | \(109\) |
risch | \(\frac {8 i {\mathrm e}^{4 i \left (d x +c \right )}+2 \,{\mathrm e}^{5 i \left (d x +c \right )}+\frac {8 i {\mathrm e}^{2 i \left (d x +c \right )}}{3}-\frac {28 \,{\mathrm e}^{3 i \left (d x +c \right )}}{3}-\frac {32 i}{15}-\frac {98 \,{\mathrm e}^{i \left (d x +c \right )}}{15}}{\left ({\mathrm e}^{i \left (d x +c \right )}+i\right )^{5} \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2} d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{a^{2} d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{a^{2} d}\) | \(137\) |
norman | \(\frac {\frac {8 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}+\frac {8 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 a d}-\frac {52}{15 a d}+\frac {4 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {28 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 a d}-\frac {148 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{15 a d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{5}}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{2}}\) | \(151\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 250 vs.
\(2 (107) = 214\).
time = 0.30, size = 250, normalized size = 2.17 \begin {gather*} \frac {\frac {4 \, {\left (\frac {37 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {35 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {10 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {30 \, \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {15 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + 13\right )}}{a^{2} + \frac {4 \, a^{2} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {5 \, a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {5 \, a^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {4 \, a^{2} \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {a^{2} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}} + \frac {15 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}}}{15 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 168, normalized size = 1.46 \begin {gather*} -\frac {34 \, \cos \left (d x + c\right )^{2} + 15 \, {\left (\cos \left (d x + c\right )^{3} - 2 \, \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, \cos \left (d x + c\right )\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 15 \, {\left (\cos \left (d x + c\right )^{3} - 2 \, \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, \cos \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 4 \, {\left (8 \, \cos \left (d x + c\right )^{2} + 3\right )} \sin \left (d x + c\right ) + 18}{30 \, {\left (a^{2} d \cos \left (d x + c\right )^{3} - 2 \, a^{2} d \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, a^{2} d \cos \left (d x + c\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\csc {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\sin ^{2}{\left (c + d x \right )} + 2 \sin {\left (c + d x \right )} + 1}\, dx}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 109, normalized size = 0.95 \begin {gather*} \frac {\frac {60 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a^{2}} - \frac {15}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}} + \frac {255 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 810 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 1120 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 710 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 193}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}^{5}}}{60 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 10.78, size = 117, normalized size = 1.02 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^2\,d}-\frac {-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-\frac {8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}+\frac {28\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}+\frac {148\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{15}+\frac {52}{15}}{a^2\,d\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )\,{\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )}^5} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________